package com.zksk.admin.api.factory;

import com.zksk.admin.api.RemoteAdminService;
import com.zksk.admin.api.RemoteDictService;
import com.zksk.admin.api.domain.SysDictData;
import com.zksk.common.core.domain.R;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class RemoteDictFallbackFactory implements FallbackFactory<RemoteDictService> {
    private static final Logger log = LoggerFactory.getLogger(RemoteDictFallbackFactory.class);

    @Override
    public RemoteDictService create(Throwable throwable) {
        log.error("系统模块调用失败:{}", throwable.getMessage());
        return new RemoteDictService() {
            @Override
            public R<List<SysDictData>> getDictDataByCode(String dictType, String source) {
                return null;
            }
        };
    }
}